import pygame
import os

pygame.init()
pygame.mixer.init()
bg_size = width, height = 600, 1000  # 背景像素
os.environ['SDL_VIDEO_WINDOW_POS'] = "%d,%d" % (610,40)
screen = pygame.display.set_mode(bg_size)
pygame.display.set_caption('飞机大战单机版')

ty_background = pygame.image.load('images/bacngroud.png').convert()
boss_background = pygame.image.load("images/boss_bg.jpeg").convert()
start_but = pygame.image.load("images/start.png").convert_alpha()
start_but_rect = start_but.get_rect()
rank_but = pygame.image.load("images/rank.png").convert_alpha()
rank_but_rect = rank_but.get_rect()
resume_but = pygame.image.load("images/resume_nor.png")
resume_but_rect = resume_but.get_rect()
pause_but = pygame.image.load("images/pause_nor.png")
pause_but_rect = pause_but.get_rect()
again_but = pygame.image.load("images/again.png")
again_but_rect = again_but.get_rect()
back_but = pygame.image.load("images/back.png")
back_but_rect = back_but.get_rect()
pausing_image = pygame.image.load("images/pausing_image.png")
pausing_image_rect = pausing_image.get_rect()
blood_slot = pygame.image.load("images/blood_slot.png")
blood_slot_rect = blood_slot.get_rect()
login_but_image = pygame.image.load("images/login_image.png")
login_but_rect = login_but_image.get_rect()
register_but_image = pygame.image.load("images/register_iamge.png")
register_but_rect = register_but_image.get_rect()
back_image = pygame.image.load("images/back.png").convert_alpha()
back_rect = back_image.get_rect()
login_turn_imame = pygame.image.load("images/login_turn_imame.png").convert_alpha()
login_turn_rect = login_turn_imame.get_rect()
reg_turn_iamge = pygame.image.load("images/reg_turn_imame.png").convert_alpha()
reg_turn_rect = reg_turn_iamge.get_rect()
logout_but = pygame.image.load("images/logout_image.png")
logout_but_rect = logout_but.get_rect()

#
bg_rank = pygame.image.load('images/bg_rank.png').convert()
background_login = pygame.image.load('images/bg_login.png').convert()
bg_fight1 = pygame.image.load('images/bg_fight1.png').convert()
bg_fight2 = pygame.image.load('images/bg_fight2.png').convert()
bg_fight3 = pygame.image.load('images/bg_fight3.png').convert()
bg_fight4 = pygame.image.load('images/bg_fight4.png').convert()
bg_choic = pygame.image.load('images/bg_choic.png').convert()
bg_end = pygame.image.load('images/bg_end.png').convert()
login_but_image2 = pygame.image.load("images/login_image.png")
login_but_rect2 = login_but_image2.get_rect()
register_but_image2 = pygame.image.load("images/register_iamge.png")
register_but_rect2 = register_but_image2.get_rect()
volume1_button_image = pygame.image.load("images/volume1.png")
volume1_button_rect = volume1_button_image.get_rect()
button_pause1 = pygame.image.load("images/pause_nor.png")
button_pause1_rect = button_pause1.get_rect()
button_back = pygame.image.load("images/button_back.png")
button_back_rect = button_back.get_rect()
button_volume1 = pygame.image.load("images/button_volume.png")
button_volume1_rect = button_volume1.get_rect()
button_volume2 = pygame.image.load("images/button_volume.png")
button_volume2_rect = button_volume2.get_rect()
warning_image = pygame.image.load("images/warning.png").convert_alpha()
warning_image_rect = warning_image.get_rect()
show_way = pygame.image.load("images/show_way.png").convert_alpha()
show_way_rect = show_way.get_rect()
show_caozuo_back = pygame.image.load("images/show_caozzuo.png").convert_alpha()
show_caozuo_rect = show_caozuo_back.get_rect()

button_volume1 = pygame.image.load("images/button_volume.png")
button_volume1_rect = button_volume1.get_rect()
button_volume2 = pygame.image.load("images/button_volume.png")
button_volume2_rect = button_volume2.get_rect()
image_bg_set1 = pygame.image.load("images/bg-set1.png")
image_bg_set1_rect = image_bg_set1.get_rect()
image_bg_set2 = pygame.image.load("images/bg-set2.png")
image_bg_set2_rect = image_bg_set2.get_rect()
background_login2 = pygame.image.load('images/bg_login2.png').convert()
image_protect1 = pygame.image.load('images/protect1.png').convert_alpha()
image_protect1_rect = image_protect1.get_rect()
button_end = pygame.image.load("images/end.png")
button_end_rect = button_end.get_rect()
#
# pygame.mixer.music.load("sound/hundouluo.wav")
# pygame.mixer.music.set_volume(0.2)
# attack_sound = pygame.mixer.Sound("sound/bullet.wav")
# attack_sound.set_volume(0.2)
# small_die_sound = pygame.mixer.Sound("sound/enemy1_down.wav")
# hero_die_sound = pygame.mixer.Sound("sound/hero_hit.WAV")
# hero_die_sound.set_volume(0.2)
#
#
#
# sound_bgm_supply = pygame.mixer.Sound("sound/bgm_supply.wav")
# sound_hero2skill = pygame.mixer.Sound("sound/hero2skill.wav")
# sound_hero1bullet = pygame.mixer.Sound("sound/hero1bullet.WAV")
# sound_hero2bullet = pygame.mixer.Sound("sound/bgm_hero2bullet.wav")
# sound_hero3bullet = pygame.mixer.Sound("sound/hero3bullet.WAV")
# sound_boss_boom = pygame.mixer.Sound("sound/bgm_boom.wav")
# sound_bgm_die  = pygame.mixer.Sound("sound/bgm_die.wav")
# sound_lastone = pygame.mixer.Sound("sound/bgm_lastone.wav")
# sound_bgm_level2 = pygame.mixer.Sound("sound/bgm_xuan.wav")
# sound_bgm1 = pygame.mixer.Sound("sound/bgm_main.wav")
# sound_bgm_boss = pygame.mixer.Sound("sound/bgm_boss~1.wav")
# sound_bgm_putong = pygame.mixer.Sound("sound/bgm_putong.wav")
# sound_bgm_rank = pygame.mixer.Sound("sound/bgm_rank.wav")
# sound_bgm_level2 = pygame.mixer.Sound("sound/bgm_xuan.wav")
# sound_supply = pygame.mixer.Sound("sound/supply.wav")
# sound_upgrade = pygame.mixer.Sound("sound/upgrade.wav")
# sound_me_down = pygame.mixer.Sound("sound/me_down.wav")
# sound_button = pygame.mixer.Sound("sound/button.wav")
# choose_plane_fly = pygame.mixer.Sound("sound/fly.wav")
# sound_bgm_hero2bullet= pygame.mixer.Sound("sound/fly.wav")
# sound_boss3 = pygame.mixer.Sound("sound/bgm_boss3.wav")
# sound_warning = pygame.mixer.Sound("sound/sound_warning.wav")


# #音效
# attack_sound.set_volume(0.2)
# small_die_sound.set_volume(0.2)
# hero_die_sound.set_volume(0.2)
# sound_bgm_supply.set_volume(0.2)
# sound_hero2skill.set_volume(0.2)
# sound_hero1bullet.set_volume(0.2)
# sound_hero2bullet.set_volume(0.2)
# sound_hero3bullet.set_volume(0.2)
# sound_boss_boom.set_volume(0.2)
# sound_supply.set_volume(0.2)
# sound_upgrade.set_volume(0.2)
# sound_me_down.set_volume(0.2)
# sound_button.set_volume(0.2)
# choose_plane_fly.set_volume(0.2)
# sound_bgm_hero2bullet.set_volume(0.2)
# sound_boss3.set_volume(0.2)
#
# #音量
# sound_bgm_boss.set_volume(0.2)
# sound_bgm_putong.set_volume(0.2)
# sound_bgm_rank.set_volume(0.2)
# sound_bgm_level2.set_volume(0.2)
# sound_bgm_die.set_volume(0.2)
# sound_lastone.set_volume(0.2)
# sound_bgm_level2.set_volume(0.2)
# sound_bgm1.set_volume(0.2)

score_font = pygame.font.Font("font/方正舒体__GBK.ttf",36)
blood_text_font = pygame.font.Font("font/rough.ttf",18)
login_fail_font = pygame.font.Font("font/方正超粗黑_GBK.ttf",20)
login_font = pygame.font.Font("font/方正舒体__GBK.ttf",30)
font_cun = pygame.font.Font("font/方正超粗黑_GBK.ttf",25)
font_volume = pygame.font.Font("font/方正舒体__GBK.ttf",50)
att_font = pygame.font.Font("font/方正舒体__GBK.ttf",20)
